<?php
$t1 = microtime(true);
// ... 执行代码 ...

$url = 'http://web.tdull.local/home/user/login';
$data = array(
    		'name' => 'test1',//错误代码
    		'password'  => '1234',//错误信息
    	);

$content = json_encode($data);//http_build_query($post);
//echo $content;
$content_length = strlen($content);
$options = array(
	'http' => array(
		'method' => 'POST',
		'header' =>
		"Content-type: application/json\r\n" .
		"Content-length: $content_length\r\n",
		'content' => $content
	)
);
echo file_get_contents($url, false, stream_context_create($options));


$t2 = microtime(true);
echo '_'.round($t2-$t1,3).'_';
?>